package com.xssn.fjnd.content.api;



import com.xssn.fjnd.content.service.ICommentService;
import com.xssn.util.base.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "评论管理API接口", description = "评论管理API接口，不需要通过身份认证就可以访问下面的接口")
@RestController
@RequestMapping("/api/comment")
public class ApiCommentController {

    @Autowired
    private ICommentService commentService;

    @ApiOperation("通过视频ID递归查询所有评论")
    @ApiImplicitParam(name = "videoId", value = "视频ID", required = true)
    @GetMapping("/list/{videoId}") // get 方式 /content/api/comment/list/1
    public Result findByArticleId(@PathVariable("videoId") String videoId) {
        return commentService.findByVideoId(videoId);
    }

}
